package cn.hector.service.impl;

import cn.hector.dao.AccountDao;
import cn.hector.domain.Account;
import cn.hector.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Qualifier("accountDao")
    @Autowired
    private AccountDao accountDao;

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public List<Account> findAll() {
        List<Account> all = accountDao.findAll();

        for(Account account:all){
            System.out.println(account);
        }

        System.out.println("service  查询所有");
        return null;
    }

    @Override
    public void saveAccount(Account account) {
        System.out.println("service  保存账户");
    }
}
